package com.xaicode.locker.JavaSJMS.three.StructureMode.Facade;

/**
 * 外观模式
 * 
 * @author Locker <br>
 *         2017年5月2日 下午12:21:06
 * @version v1.0
 */
public class Facade {

	private CPU cpu;

	private Memory memory;

	private Disk disk;

	public Facade() {
		cpu = new CPU();
		memory = new Memory();
		disk = new Disk();
	}

	public void startup() {
		System.out.println("start the computer!");
		cpu.startup();
		memory.startup();
		disk.startup();
		System.out.println("start computer finished!");
	}

	public void shutdown() {
		System.out.println("begin to close the computer!");
		cpu.shutdown();
		memory.shutdown();
		disk.shutdown();
		System.out.println("computer closed!");
	}

}
